package com.cloudbroker.openapi.manage.controller;

import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.feedback.back.FeedbackList;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.feedback.back.FeedbackSubBack;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.feedback.vo.FeedbackAddForm;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.feedback.vo.FeedbackQueryForm;
import com.cloudbroker.bcs.platform.ltb.bizapi.t2service.social.FeedbackT2BizService;
import com.cloudbroker.bcs.platform.ltb.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import static com.cloudbroker.bcs.platform.ltb.common.util.RequestUtil.getSingleParameterMapForBody;

/**
 * Created by fangyf18371 on 2016/7/15.
 * 意见反馈粉丝端
 */
@Controller
public class FeedbackController {
    @Resource
    private FeedbackT2BizService feedbackT2BizService;

    @ResponseBody
    @RequestMapping("/feedback_add")
    @SaveLog(remark = "意见反馈")
    public FeedbackSubBack feedback_add(HttpServletRequest request, String jsonpcallback){
        FeedbackAddForm form=getSingleParameterMapForBody(request,FeedbackAddForm.class);
        return VOUtil.setJsonpResult(feedbackT2BizService.feedback_add(form),jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/feedback_query")
    @SaveLog(remark = "我的反馈")
    public FeedbackList feedback_query(HttpServletRequest request, String jsonpcallback){
        FeedbackQueryForm form=getSingleParameterMapForBody(request,FeedbackQueryForm.class);
        return VOUtil.setJsonpResult(feedbackT2BizService.feedback_query(form),jsonpcallback);
    }
}
